import React, { useMemo } from 'react';
import { connect } from 'umi';

import Layout404 from '@/pages/404';
import BaseInformation from '@/pages/base-information';
import WorkCenter from '@/pages/work-center';
import Calendar from '@/pages/calendar';

/**
 *
 * @param {*} props
 * @returns 主框架自定义添加页面
 */
const BaseOtherDOM = (props) => {
  const { target } = props;
  // 渲染基本信息组件
  const renderComponents = () => {
    // component 页面类型
    switch (target) {
      case 'base-information': return <BaseInformation />; // 基本信息
      case 'work-center': return <WorkCenter />; // 首页
      case 'calendar': return <Calendar />; // 日历
      default: return <Layout404 />;
    }
  };

  return renderComponents();
};

export default connect()(BaseOtherDOM);
